﻿// <copyright file="Shell.cs" company="DotNetLib">
//
// .netlib: http://www.codeplex.com/DotNetLib
//
// Portions of this were part of the CodePlex "Extensions for .NET Framework"
//    project and written by Marco Minerva, mailto:marco.minerva@gmail.com
//
// This code is released under the New BSD License.
// A copy of this license is available at:
// http://www.codeplex.com/DotNetLib/license
//
// </copyright>

namespace DotNetLib.Windows
{
  using System;
  using System.IO;
  using DotNetLib.IO;

  /// <summary>
  /// The <strong>Shell</strong> class wraps some Windows shell function (like moving a file to <strong>Recycle Bin</strong>, adding a file
  /// to the <strong>Recent Dos</strong> menu...).
  /// </summary>
  [Obsolete("Replaced with functionality in DotNetLib.IO.FileInfoExtensions", true)]
  public static class Shell
  {
    /// <summary>
    /// Moves a file to the <strong>Windows Recycle Bin</strong>.
    /// </summary>
    /// <param name="fileName">The name of the file to be moved to the <strong>Recycle Bin</strong>.</param>
    /// <remarks>A confirmation dialog will be displayed before deleting the file.</remarks>
    [Obsolete("Replaced with functionality in DotNetLib.IO.FileInfoExtensions", true)]
    public static void MoveToRecycleBin(string fileName)
    {
      MoveToRecycleBin(fileName, true);
    }

    /// <summary>
    /// Moves a file to the <strong>Windows Recycle Bin</strong>.
    /// </summary>
    /// <param name="fileName">The name of the file to be moved to the <strong>Recycle Bin</strong>.</param>
    /// <param name="showConfirmationDialog">if set to <c>true</c>, a confirmation dialog will be displayed before deleting the file.</param>
    [Obsolete("Replaced with functionality in DotNetLib.IO.FileInfoExtensions", true)]
    public static void MoveToRecycleBin(string fileName, bool showConfirmationDialog)
    {
      (new FileInfo(fileName)).DeleteToRecycleBin(showConfirmationDialog);
    }

    /// <summary>
    /// Adds a file to the <strong>Recent Docs</strong> menu.
    /// </summary>
    /// <param name="fileName">The name of the file to be added to the <strong>Recent Docs</strong> menu.</param>
    [Obsolete("Replaced with functionality in DotNetLib.IO.FileInfoExtensions", true)]
    public static void AddToRecentDocs(string fileName)
    {
      (new FileInfo(fileName)).AddToRecentDocuments();
    }
  }
}
